#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2018/12/6 10:44
# @Author  : lizhen
# @Site    : 
# @File    : prop.py
# @Software: PyCharm


class ClsVsObj:
    cls_property = 'cls_p'


def main():
    print(ClsVsObj.cls_property)

    # 修改类属性
    # ClsVsObj.cls_property = 'cls_p_cls'
    # print(ClsVsObj.cls_property)
    # del ClsVsObj.cls_property
    # assert not hasattr(ClsVsObj, 'cls_property')

    # 修改对象属性
    obj = ClsVsObj()
    obj.cls_property = 'cls_p_obj'
    print(obj.cls_property)
    print(ClsVsObj.cls_property)
    del obj.cls_property
    print(obj.cls_property)
    print(ClsVsObj.cls_property)


if __name__ == '__main__':
    main()
